package com.qf.controller;

import com.qf.feign.TestFeign;
import com.qf.pojo.User;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 千锋教育
 * @Company http://www.mobiletrain.org/
 * @Version 1.0
 */
@RestController
@RequestMapping("/custom")
@Api(tags = "测试模块",description = "测试接口")
public class TestController {


    @Autowired
    TestFeign testFeign;

    @GetMapping("/test")
    @ApiOperation(value = "测试方法")
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "username", value = "用户名"),
//            @ApiImplicitParam(name = "password", value = "密码")
//    })
    @ApiResponses({
            @ApiResponse(code = 401,message = "没有认证"),
            @ApiResponse(code = 500,message = "后端控制错误")
    })
    public String test(User user){
        String test = testFeign.test();
        return "消费者 -- 测试 :: " + test;
    }
}
